extends "../cTDA_3/cTDA_3.gd"
func _info():
	pass

func _connect():
	._connect()

func _extInit():
	._extInit()
	chaName = "海盗"
	lv = 3
	attCoe.atk = 25 / 8.5 * 2 / 3
	attCoe.maxHp = 750 / 112.5 / 3

	addCdSkill("hd",6)
	addCdSkill("hd2",7)
	addSkillTxt("潮涌：[主动]对所有敌人造成110%伤害[cd:6秒][被动]每使用一次潮涌，潮涌cd-1秒,最低2秒")
	addSkillTxt("船体冲锋：对当前敌人及其九宫格敌人造成150%物理伤害，并附加1层<眩晕>[cd:7秒]")

var maxc = 80
var minc = 50
var usecnt:int = 0
func _onBattleStart():
	._onBattleStart()
	usecnt = 0

func _onBattleEnd():
	._onBattleEnd()
	getSkill("hd").cd = 6

func _castCdSkill(id):
	._castCdSkill(id)
	var chas = getAllChas(1)
	if id == "hd" :
		if !chas.size():return 
		cst("潮涌","000000",position)
		for i in chas:
			hurtChara(i,att.atk * 1.1,Chara.HurtType.PHY,Chara.AtkType.SKILL)
		usecnt += 1
		getSkill("hd").cd = max(2,6 - usecnt)

	if id == "hd2" && aiCha:
		var vs = [Vector2(0,0),Vector2(1,0),Vector2(-1,0),Vector2(0,1),Vector2(0,-1),Vector2(1,1),Vector2(-1,1),Vector2(-1,-1),Vector2(1,-1)]
		var c = aiCha.cell
		for i in vs:
			if sys.main.isMatin(i + c):
				var cha = matCha(i + c)
				if !cha:continue
				if cha.get("team") != self.team:
					cha.addBuff(ctrl.b_xuanyun.new(1))
					hurtChara(cha,att.atk * 1.5,Chara.HurtType.PHY,Chara.AtkType.SKILL)